|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
JBossDDWriter.java | 50% | 95% | 100% | 83.3% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
package org.apache.geronimo.ews.ws4j2ee.toWs.dd.jboss;
|
|
17 |
|
|
18 |
import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
|
|
19 |
import org.apache.geronimo.ews.ws4j2ee.toWs.AbstractWriter;
|
|
20 |
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
|
|
21 |
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* @author Srinath Perera(hemapani@opensource.lk)
|
|
25 |
*/
|
|
26 |
public class JBossDDWriter extends AbstractWriter { |
|
27 | 8 |
public JBossDDWriter(J2EEWebServiceContext j2eewscontext) throws GenerationFault { |
28 | 8 |
super(j2eewscontext, j2eewscontext.getMiscInfo().getOutPutPath() +
|
29 |
"/META-INF/jboss.xml");
|
|
30 |
} |
|
31 |
|
|
32 | 8 |
public void writeCode() throws GenerationFault { |
33 | 8 |
if (out == null) |
34 | 0 |
return;
|
35 | 8 |
String ejbname = j2eewscontext.getWSDLContext().getTargetPortType().getName().toLowerCase(); |
36 | 8 |
int index = ejbname.lastIndexOf("."); |
37 | 8 |
if (index > 0) {
|
38 | 8 |
ejbname = ejbname.substring(index + 1); |
39 |
} |
|
40 | 8 |
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
41 | 8 |
out.write("<jboss>\n");
|
42 | 8 |
out.write(" <enterprise-beans>\n");
|
43 | 8 |
out.write(" <session>\n");
|
44 | 8 |
out.write(" <ejb-name>" + ejbname + "</ejb-name>\n"); |
45 | 8 |
String implStyle = j2eewscontext.getMiscInfo().getImplStyle(); |
46 | 8 |
if (GenerationConstants.USE_LOCAL_AND_REMOTE.equals(implStyle)
|
47 |
|| GenerationConstants.USE_REMOTE.equals(implStyle)) { |
|
48 | 8 |
out.write(" <jndi-name>" + "ejb/" + ejbname + "</jndi-name>\n"); |
49 |
} |
|
50 | 8 |
if (GenerationConstants.USE_LOCAL_AND_REMOTE.equals(implStyle)
|
51 |
|| GenerationConstants.USE_LOCAL.equals(implStyle)) { |
|
52 | 8 |
out.write(" <local-jndi-name>" + "ejb/" + ejbname + "Local" + "</local-jndi-name>\n"); |
53 |
} |
|
54 | 8 |
out.write(" </session>\n");
|
55 | 8 |
out.write(" </enterprise-beans>\n");
|
56 | 8 |
out.write("</jboss>\n");
|
57 |
} |
|
58 |
} |
|
59 |
|
|